'use strict';

require('../../assets/scss/entry/common.scss');
require('../../assets/scss/entry/register.scss');

let $ = jQuery = window.jQuery = window.$ = require('jquery');

import * as api from '../../components/api/index.js';
import url from '../../components/util/url.js';
import util from '../../components/util/util.js';

let pageEntry = (function() {

	return {
		setWindowHeight() {
			// 获取视窗高度，将背景图铺满屏幕
			let wh = (window.innerHeight > 0) ? window.innerHeight : screen.height;
			$('body').height(wh);
		},
		bindEvent() {
			let registerType = url.getQuery("registerType");
			if(registerType == 1){
				let agencyNumber = url.getQuery("agencyNumber");
				$(".success-content-number").empty().html(agencyNumber);
				$(".register-success-content .hide").show();
				setTimeout(function() {
					window.location = "/agencyLogin.html";
				},3000);
			}else{
				$(".firstTitle").empty().html("恭喜您注册成功").show();
				setTimeout(function(){
					window.location = "/indiviInfo.html";
				},2000);
			}
		}
	}
})();

pageEntry.setWindowHeight();
pageEntry.bindEvent();
